<template>
	<div class="Word">
		<form id="form1">
			<div style=" text-align:center;">
				<div>请选择登录用户：</div>
				<br />
				<select name="userName" v-model="userName">
					<option value="zhangsan">A部门经理</option>
					<option value="lisi" >B部门经理</option>
				</select><br /><br />
				<input type="button" @click="open_pageoffice()" value="打开文件" /><br /><br />
				<div style=" color:Red;">不同的用户登录后，在文档中可以编辑的区域不同</div>
			</div>
		</form>
	</div>
</template>

<script>
import request from '@/utils/request'
import { POBrowser } from 'js-pageoffice'
export default {
	name: 'index',
	data() {
		return {
			titleText: '',
			userName:'zhangsan'
		}
	},
	created: function () {
		this.index().then(response => {
			this.titleText = response;
		});
	},
	methods: {
		open_pageoffice() {
			POBrowser.openWindow("/SetDrByUserWord2/Word", 'width=1200px;height=800px;',this.userName);
		},
		index() {
			//发起GET请求到后端Controller的/index路由
			return request({
				url: '/index',
				method: 'get',
			})
		}
	}
}
</script>
